FlyTalk.views.ItinMapView = Ext.extend(Ext.TabPanel, {
    id: 'ItinMapView',
	scroll: false,
    indicator: true,
    fullscreen: true,
    layout: 'card', 
	title: 'itinmapview',
        
	items: [
		{
			title: 'Tab 1',
			html : '1',
			cls  : 'card1',     
		},
		{
			title: 'Tab 2',
			html : '2',
			cls  : 'card2',
		},
    ],
	
    tabBar:{
        dock: 'bottom', // will put the menu on the bottom of the screen
		layout:{
			type: 'hbox',
			pack: 'center' // this will center the menu
        },		
    },
        
	listeners: {
		cardswitch: function(container, newCard, oldCard, index,  animated ){
			if (index==1){
				this.filterButton.setVisible(false);
			}else{
				this.filterButton.setVisible(true);
			}
			
			
		},
	},
	
    initComponent: function () {
        this.backButton = new Ext.Button({
			//text: 'Back',
			iconCls: 'home',
			iconMask: true,
			handler: this.backButtonTap,
			scope: this
		});
        
        this.locateButton = new Ext.Button({
			//text: 'Back',
			iconCls: 'locate',
			iconMask: true,
			scope: this
		});
		
		this.filterButton = new Ext.Button({
        	//iconMask: true, 
			text: 'Menu',
        	ui: 'action', 
        	//iconCls: 'add',
			id: 'mapFilterButton',
			handler: this.filterButtonTap,
			scope: this
		});
		
		this.toolbar = new Ext.Toolbar({
				title: 'myRoute',
				doc: 'top',
				layout: 'hbox',
				hidden: false,
				items: [
					this.backButton,
					{xtype: 'spacer'},
					this.locateButton,
					this.filterButton,
				]
		});
		
		this.dockedItems = [this.toolbar];
		
		Ext.apply(FlyTalk.views, {
				ItinView: new FlyTalk.views.ItinView(),
				MapTab: new FlyTalk.views.MapTab(), 
				MapZoom: new FlyTalk.views.MapZoom(),
                        
        });
                
		this.items = [FlyTalk.views.MapTab, FlyTalk.views.ItinView ];
				
		FlyTalk.views.ItinMapView.superclass.initComponent.call(this);
        
    },
	    
	filterButtonTap: function () { // to open the image overlay 
		//this.overlay.hide();
		Ext.dispatch({
			controller: FlyTalk.views.MapTab,
			action: 'filterButtonTap'
		});
	},
	
	
	backButtonTap: function () {
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },


});